package br.com.mtg.movethegarbage.framework;

import android.media.SoundPool;

public class Sound
{
	int soundID;
	SoundPool pool;
	boolean ready;

	public Sound(SoundPool _pool, int _soundID)
	{
		soundID = _soundID;
		pool = _pool;
		ready = false;
	}

	public int play(float volume)
	{
		int streamID = pool.play(soundID, volume, volume, 0, 0, 1.0F);
		return streamID;
	}

	public void dispose()
	{
		pool.unload(soundID);
	}

	public boolean isReady()
	{
		return ready;
	}

	public void onLoad(int sampleId)
	{
		if (soundID == sampleId)
			ready = true;
	}
}
